# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=XML-SAX
pkgname=perl-${_realname}
pkgver=1.00
pkgrel=1
pkgdesc="Simple API for XML"
arch=('any')
url="https://metacpan.org/release/XML-SAX"
groups=('perl-modules')
license=('GPL' 'PerlArtistic')
depends=('perl' 'perl-XML-SAX-Base' 'perl-XML-NamespaceSupport')
options=('!emptydirs')
install=perl-xml-sax.install
source=("https://www.cpan.org/authors/id/G/GR/GRANTM/${_realname}-${pkgver}.tar.gz"
        'perl-xml-sax.patch')
sha256sums=('45ea6564ef8692155d57b2de0862b6442d3c7e29f4a9bc9ede5d7ecdc74c2ae3'
            '79cd182088243cae4a78448df35e0dc17448f5acbfb2dcce222f6d1100ab6280')

prepare() {
  cd ${srcdir}/${_realname}-${pkgver}
  patch -Np1 -i "${srcdir}/perl-xml-sax.patch"
}

build() {
  cd ${srcdir}/${_realname}-${pkgver}
  PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
  make
}

check() {
  cd ${srcdir}/${_realname}-${pkgver}
  make test
}

package() {
  cd ${srcdir}/${_realname}-${pkgver}
  make install DESTDIR=$pkgdir

  find $pkgdir -name '.packlist' -delete
  find $pkgdir -name '*.pod' -delete
}
